Skip to content

Conversation

@jorenbroekema
Copy link

@sei-vsarvepalli

Please take a look. I tried to incorporate the fix in the code and clean it up a little but I'm left with 2 failing tests, which also fail on your branch.
Need some helping fixing those tests (or implementation). then happy to merge.

jorenbroekema and others added 3 commits January 10, 2024 20:37
Co-authored-by: Vijay Sarvepalli <vssarvepalli@cert.org>
@jorenbroekema jorenbroekema mentioned this pull request Nov 25, 2025
src/evaluate.js Outdated
// function definition is included in registered functions
if (Object.values(expr.functions).includes(f)) return true;
// marked as safe already
if (f.__expr_eval_safe_def) return true;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is problematic we should remove it and move it to more reliable way. As this __expr_eval_safe_def can be user defined. It is not safe to trust it.

@sei-vsarvepalli
Copy link

Yeh - needs a little more work. I think

@sei-vsarvepalli

Please take a look. I tried to incorporate the fix in the code and clean it up a little but I'm left with 2 failing tests, which also fail on your branch. Need some helping fixing those tests (or implementation). then happy to merge.

See my https://github.com/sei-vsarvepalli/expr-eval-secure/tree/member-access branch that should fix all the tests and the more security problems that were found from using __expr_eval_safe_def property that can be object defined and NOT trusted.

Please test, fix any README's, indentation etc. and release at your convenience.

@sei-vsarvepalli
Copy link

Yeh - needs a little more work. I think

@sei-vsarvepalli
Please take a look. I tried to incorporate the fix in the code and clean it up a little but I'm left with 2 failing tests, which also fail on your branch. Need some helping fixing those tests (or implementation). then happy to merge.

See my https://github.com/sei-vsarvepalli/expr-eval-secure/tree/member-access branch that should fix all the tests and the more security problems that were found from using __expr_eval_safe_def property that can be object defined and NOT trusted.

Please test, fix any README's, indentation etc. and release at your convenience.

hello @jorenbroekema

Any questions? or any feedback you need?

@Mwpereira
Copy link

Hi @sei-vsarvepalli, while I appreciate the efforts of this fork, I am creating an actively maintained, community-driven fork of expr-eval to address this fix and future ones. I have also been awaiting this security patch and figured to move forward with a fork of my own. 🙂

If you would like, please open a pull request addressing this change, which you have done here, or I will go ahead and make the change by the end of the day tomorrow. expr-eval-community

Thank you!

@jorenbroekema
Copy link
Author

Hi @sei-vsarvepalli, while I appreciate the efforts of this fork, I am creating an actively maintained, community-driven fork of expr-eval to address this fix and future ones. I have also been awaiting this security patch and figured to move forward with a fork of my own. 🙂

If you would like, please open a pull request addressing this change, which you have done here, or I will go ahead and make the change by the end of the day tomorrow. expr-eval-community

Thank you!

Or you could raise a PR to this branch to fix it with @sei-vsarvepalli tips, also happy to invite you as a collaborator to this one if that helps. I think more forks will just increase friction right?

I just haven't found the time (unemployed, looking for a new job, christmas holidays coming up etc.) to wrap this up myself but happy to get help on it.

@Mwpereira
Copy link

Mwpereira commented Dec 7, 2025

No worries at all! I completely understand where you're coming from, and I hope my comment didn't come across the wrong way! Fewer forks would definitely make things smoother. I have seen a few forks of this package now due to the security issues that have arisen - @jorenbroekema

If we could get this PR merged, that would be fantastic: jorenbroekema#3.

jorenbroekema and others added 2 commits December 7, 2025 19:04
Co-authored-by: Vijay Sarvepalli <vssarvepalli@cert.org>
@jorenbroekema
Copy link
Author

jorenbroekema commented Dec 7, 2025

@Mwpereira no worries, I know you mean well and I get that folks want to get this fixed rather sooner than later :)

I had some time today to open jorenbroekema#4 which combines jorenbroekema#3 + my minor improvements + version bump and changelog entry, I had one question about a small code change that I'm not sure we still need, besides that we can merge and release it to NPM I think.

I'd like to get at least you and @sei-vsarvepalli as contributors to expr-eval-fork and set up CI/CD so we can move things along faster next time with at least the 3 of us and not be blocked by my personal schedule and/or lack of time. I appreciate the idea of making it more of a community fork 😅 I'd rather not maintain it alone hehe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants